home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 March / Gamestar_71_2005-03_dvd.iso / Dema / willofsteel_demo.exe / {app} / Data / Shaders / decal00.fx next >
Text File  |  2004-10-23  |  3KB  |  135 lines

  1. float4x4 WorldViewProjection;
  2. float4x4 ShadowViewProjection;
  3. float4x4 TextureMatrix;
  4. float4x4 WorldMatrix;
  5. float4x4 ViewIT;
  6. float4x4 DecalMatrix;
  7.  
  8. texture DiffuseTexture;
  9. texture ShadowTexture;
  10. texture CloudsTexture;
  11.  
  12. float4 SunColor       = { 1., 0.86, .70, .0 };
  13. float4 Ambient        = { 0.24, 0.12, 0.04, 1.0 };
  14. float3 LightDirection = { 0.7, 0.7, 0.0 };
  15. float4 ZBias          = { 1.0, 0.0, 0.0, -0.003 };
  16. float3 UpVector       = { 0.0, 1.0, 0.0 };
  17.  
  18. float4 Zero           = { .0, .0, .0, .0 };
  19.  
  20. float4 Selected       = { .0, 1., .0, 1. };
  21.  
  22. float4 CloudUVShift    = { 0.0, 0.0, 0.0, 0.0 };
  23. float4 CloudScale      = { 0.01, 0.01, 0.01, 0.01 };
  24.  
  25. technique Technique0
  26. {
  27.     pass Pass0
  28.     {
  29.         Texture[0]               = (DiffuseTexture);
  30.  
  31.         ColorOp[0]            = SELECTARG1;
  32.         ColorArg1[0]        = TEXTURE;
  33.         AlphaOp[0]            = MODULATE;
  34.         AlphaArg1[0]        = TEXTURE;
  35.         AlphaArg2[0]        = DIFFUSE;
  36.  
  37.         ColorOp[1]            = DISABLE;
  38.         AlphaOp[1]            = DISABLE;
  39.  
  40.         VertexShaderConstant[0]   = <WorldViewProjection>;
  41.         VertexShaderConstant[4]   = <ShadowViewProjection>;
  42.         VertexShaderConstant[8]   = <TextureMatrix>;
  43.         VertexShaderConstant[12]  = <WorldMatrix>;
  44.         VertexShaderConstant[16]  = <ViewIT>;
  45.         VertexShaderConstant[20]  = <DecalMatrix>;
  46.         VertexShaderConstant[30]  = <LightDirection>;
  47.         VertexShaderConstant[31]  = <ZBias>;
  48.         VertexShaderConstant[32]  = <SunColor>;
  49.  
  50.         VertexShader =
  51.         decl
  52.         {
  53.             stream 0;
  54.             float v0[3];    
  55.             float v3[3];    
  56.             float v6[4];    
  57.             float v10[2];   
  58.         }
  59.         asm
  60.         {
  61.             vs_1_1
  62.  
  63.             dcl_position v0
  64.             dcl_normal v3
  65.             dcl_color  v6
  66.             dcl_texcoord0  v10
  67.  
  68.             m4x4  oPos, v0, c0    
  69.             m4x4  oT0, v10, c20    
  70.             dp3   r0, v3, c30
  71.             mul   r0, r0, c32
  72.             mov   r0.a, v6.a
  73.             mov   oD0, r0
  74.         };
  75.  
  76.         PixelShaderConstant[17]  = <Ambient>;
  77.  
  78.         PixelShader = NULL;
  79.     }
  80. }
  81.  
  82.  
  83.  
  84. technique Technique1
  85. {
  86.     pass Pass0
  87.     {
  88.         Texture[0]               = (DiffuseTexture);
  89.  
  90.         ColorOp[0]            = SELECTARG1;
  91.         ColorArg1[0]        = TEXTURE;
  92.         AlphaOp[0]            = MODULATE;
  93.         AlphaArg1[0]        = TEXTURE;
  94.         AlphaArg2[0]        = DIFFUSE;
  95.  
  96.         ColorOp[1]            = DISABLE;
  97.         AlphaOp[1]            = DISABLE;
  98.  
  99.  
  100.         VertexShaderConstant[0]   = <WorldViewProjection>;
  101.         VertexShaderConstant[12]  = <WorldMatrix>;
  102.         VertexShaderConstant[16]  = <ViewIT>;
  103.         VertexShaderConstant[30]  = <LightDirection>;
  104.         VertexShaderConstant[31]  = <ZBias>;
  105.         VertexShaderConstant[32]  = <SunColor>;
  106.  
  107.         VertexShader =
  108.         decl
  109.         {
  110.             stream 0;
  111.             float v0[3];
  112.             float v3[3];
  113.             float v6[4];
  114.             float v10[2];
  115.         }
  116.         asm
  117.         {
  118.             vs_1_1
  119.  
  120.             dcl_position v0
  121.             dcl_normal v3
  122.             dcl_color  v6
  123.             dcl_texcoord0  v10
  124.  
  125.             m4x4  oPos, v0, c0
  126.             mov   oT0, v10
  127.             mov   oD0, v6
  128.         };
  129.  
  130.         PixelShaderConstant[0]  = <Ambient>;
  131.  
  132.         PixelShader = NULL;
  133.     }
  134. }
  135.